package com.bridge.client.bridgedynamcclient.utils;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;

public class DateUtils {

    public static final String DATE_FORMAT_19 = "yyyy-MM-dd HH:mm:ss";
    public static final String DATE_FORMAT_20 = "yyyy-MM-dd HH:mm:ss.SSS";
    public static  String formatTime(String originTime,String originFormat,String targetFormat){

        DateTime parse = DateUtil.parse(originTime, originFormat);

        return DateUtil.format(parse,targetFormat);
    }

    public static  String formatTime(String originTime){
        DateTime parse = DateUtil.parse(originTime, DATE_FORMAT_20);
        return DateUtil.format(parse,DATE_FORMAT_19);
    }
}
